improve handling of not logged in