fix session detection not working