fixed initial connection bugs in handshaking, new bug where if client quits it is interpreted badly at server end