handling broken sockets