fix 500 errors for logged in user