removing dialogs from the dom once we close them