add a event based method