Fix error if user is not logged in