added .try call for session variables

to check for nil