add event for end