fix endian selection