do handshake in the new thread