fix write bug initial handshake starts