Trying to make the client disconnect properly