Make sure the session is closed