added event listener to rule