fixed error when invalid user was logged into a session.