fix session loop.