fix issues with closing dialogs
Merge pull request #2033 from devoncarew/devoncarew_close_dialogs

fix issues with closing dialogs