is there a more direct way you can handle anonymous users? A lot of things can raise an AttributeError