add code for action “cancel” and “save”