make sure session is not null