modify the session checking