fix rule saving