fix session management