add clear method for register event callback funciton