detect whether 'save' or 'delete' button was pressed.
rm code