fixes 500 error when logged out.