Add create event and view event function