Add clear event function