add delegateEventsForAttr function