fix reversing the wrong byte buffer