Add confirmation dialog to the undo button