fixed a fatal in socket registry where socket.handshake was undefined after the socket disconnected