Disconnect only if the client is connected