fixed typo in write_byte