threading issue and handshake solved