fix session close