fix rule bugs