added null check to session helper