fix issue with endianness