bug fix in rules