Custom rule is not being applied to events