try/finally for showing modal dialogs