changed custom attributes to event/hook system