fix bugs on rule saveing and loading