fix encode payload as binary, the buffer type flag always 0, which is wrong