Try Except block for accessing session data