adding start and end events.