fixed bug in add_rule function when passing in a callback as a rule