Fixed: send handshake only in the connect method. To avoid sending handshakes from servers
code formatting