add event/rule logic