Fixed a bug where the server would crash when a client disconnected