Fix for when session is None