cleaned up session management