prevent errors when a logged in user visits the login page (fixes #29)