diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 13348b455d1cc3103bba93fd5cbbbe882e6c74fa..7c4483cefcf03a535fb809900361cd984e1716d1 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -387,7 +387,10 @@ var OCdialogs = {
 						closeOnEscape: true,
 						modal: true,
 						buttons: buttonlist,
-						closeButton: null
+						closeButton: null,
+						close: function(event, ui) {
+							$(this).ocdialog('destroy').remove();
+						}
 					});
 
 					$(dialog_id).css('height','auto');