Ensured that jQuery dialogs are removed on close