fix dynamic rules, it was deleting the wrong rules on remove_rule

seems that no one used this =)