Fix fatal error if no session
Not sure
Bug fix