diff --git a/boxes.js b/boxes.js
index 606639e..05240c3 100644
--- a/boxes.js
+++ b/boxes.js
@@ -28,9 +28,10 @@
         .dialog({
           modal : true,
           close: function(e){
-             //handle someone closing the box without clicking any buttons             
-             $(response.selector).removeClass('hasPopup');
-             $(this).remove();
+             //handle someone closing the box without clicking any buttons
+             $(response.selector).removeClass('hasPopup').html(Drupal.t('Loading...'));
+             $('.boxes-ajax.use-ajax-submit.form-submit[value="Cancel"]').click();
+             $(this).remove().dialog('destroy');
           },
           open: function(ui, event){
             $(this).siblings('.ui-dialog-titlebar').children('.ui-dialog-titlebar-close').click(function(e){
@@ -51,7 +52,6 @@
 
   Drupal.behaviors.boxes = { 
     attach: function(context, settings) {
-      
       $('div.boxes-box-controls a:not(.boxes-processed)')
         .addClass('boxes-processed')
         .click(function() {
