adding an endianness check