add the check for little endian and big endian