add cancel function

add a canceling function to be triggered when user clicks on cancel in a confirm() modal.