small bug fix to session handling