fix session check