diff --git a/lib/yui/src/notification/js/alert.js b/lib/yui/src/notification/js/alert.js
index 45a0732..d446089 100644
--- a/lib/yui/src/notification/js/alert.js
+++ b/lib/yui/src/notification/js/alert.js
@@ -21,7 +21,7 @@ ALERT = function(config) {
     ALERT.superclass.constructor.apply(this, [config]);
 };
 Y.extend(ALERT, M.core.dialogue, {
-    closeEvents: [],
+    closeEvents: {},
     initializer : function() {
         this.publish('complete');
         var yes = Y.Node.create('<input type="button" id="id_yuialertconfirm-' + this.get('COUNT') + '" value="'+this.get(CONFIRMYES)+'" />'),
@@ -34,7 +34,8 @@ Y.extend(ALERT, M.core.dialogue, {
         this.setStdModContent(Y.WidgetStdMod.HEADER,
                 '<h1 id="moodle-dialogue-'+this.get('COUNT')+'-header-text">' + this.get(TITLE) + '</h1>', Y.WidgetStdMod.REPLACE);
         this.after('destroyedChange', function(){this.get(BASE).remove();}, this);
-        this.closeEvents.push(
+        this.closeEvents[this.get('COUNT')] = [];
+        this.closeEvents[this.get('COUNT')].push(
             Y.on('key', this.submit, window, 'down:13', this),
             yes.on('click', this.submit, this)
         );
@@ -42,13 +43,14 @@ Y.extend(ALERT, M.core.dialogue, {
         var closeButton = this.get('boundingBox').one('.closebutton');
         if (closeButton) {
             // The close button should act exactly like the 'No' button.
-            this.closeEvents.push(
+            this.closeEvents[this.get('COUNT')].push(
                 closeButton.on('click', this.submit, this)
             );
         }
     },
     submit : function() {
-        new Y.EventHandle(this.closeEvents).detach();
+        new Y.EventHandle(this.closeEvents[this.get('COUNT')]).detach();
+        delete this.closeEvents[this.get('COUNT')];
         this.fire('complete');
         this.hide();
         this.destroy();
