Added debug messages to SocketHandler