bug fix and changed the rule