corrected buffer byte order