fixed bug in buffer transmit