Bug Fix

* fixed some handshake logic, now should works well