fix double endian conversion