fix session handler