fix to make loginrequired work