Close all dialogs once they have executed their desired command