Fixed client disconnect

Fixed the bug that when a client disconnects the next client wont work.