implemented handshake retry on the client side