adding saveEvent() js function