fix session related bug