add cancel function to event_func