diff --git a/lib/namespace.js b/lib/namespace.js
index <HASH>..<HASH> 100644
--- a/lib/namespace.js
+++ b/lib/namespace.js
@@ -141,21 +141,25 @@ Namespace.prototype.add = function(client, fn){
   var self = this;
   this.run(socket, function(err){
     process.nextTick(function(){
-      if (err) return socket.err(err.data || err.message);
-
-      // track socket
-      self.sockets.push(socket);
-
-      // it's paramount that the internal `onconnect` logic
-      // fires before user-set events to prevent state order
-      // violations (such as a disconnection before the connection
-      // logic is complete)
-      socket.onconnect();
-      if (fn) fn();
-
-      // fire user-set events
-      self.emit('connect', socket);
-      self.emit('connection', socket);
+      if ('open' == client.conn.readyState) {
+        if (err) return socket.error(err.data || err.message);
+
+        // track socket
+        self.sockets.push(socket);
+
+        // it's paramount that the internal `onconnect` logic
+        // fires before user-set events to prevent state order
+        // violations (such as a disconnection before the connection
+        // logic is complete)
+        socket.onconnect();
+        if (fn) fn();
+
+        // fire user-set events
+        self.emit('connect', socket);
+        self.emit('connection', socket);
+      } else {
+        debug('next called after client was closed - ignoring socket');
+      }
     });
   });
   return socket;
namespace: make sure not to fire `connection` if underlying client closed after `next` is called from a middleware