add event to component