implemented last step of handshake
fixed