fix error when user not logged in