         
         var hashValue: Int { return messageId.hashValue }
         
-        static func == (lhs: Connection, rhs: Connection) -> Bool { return lhs.messageId == rhs.messageId }
-    }
-    
-    private var connections: NSMutableSet = NSMutableSet()
+        static func == (lhs: Connection, rhs: Connection) -> Bool {
+            return lhs.messageId == rhs.messageId && lhs.token == rhs.token
+        }
+    }
+    
+    private var connections: Set<Connection> = Set()
     
     private func complete(connection: Connection) {
         connectionQueue.async {
             guard self.connections.contains(connection) else { return }
             self.connections.remove(connection)
-            curl_multi_remove_handle(self.curlHandle, connection.handle)
-            self.handleCompleted(connection: connection)
+            self.performQueue.async {
+                print(">>> END \(connection.messageId) for \(connection.token)")
+                curl_multi_remove_handle(self.curlHandle, connection.handle)
+                self.handleCompleted(connection: connection)
+            }
         }
     }
     

    }
    
    // MARK: CURL Config
    
    private func createCurlMultiHandle() -> UnsafeMutableRawPointer {
        let curlHandle = curl_multi_init()
        // Apples APNS server don't support pipelining yet.
        // curlHelperSetMultiOpt(curlHandle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX)
        return curlHandle!
    }
    
    private func configureCurlHandle(for message: ApplePushMessage,
                                     to deviceToken: String,

            }
        }
        
        self.curlHandle = curl_multi_init()
        curlHelperSetMultiOpt(curlHandle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX)
    }
    
    deinit {
