bugfix: now handles client disconnection from server to handle error when sending messages to disconnected clients