fix checking the session