fix loop bug in showrestrictions