fix a bug: only set the first and the last byte in the 32bit value