fixed bugs when saving access rules