add 'cancel' processing for gui dialogues