updated to use handshake