corrected generation as it was sending 2 bytes more than in the set template (2-byte junk at the end)