         }
         
         if hasBinary {
-            if !ack {
+            if ack == nil {
                 str = SocketEvent.createMessageForEvent(event, withArgs: items,
                     hasBinary: true, withDatas: emitDatas.count, toNamespace: self.nsp)
             } else {
                 str = SocketEvent.createMessageForEvent(event, withArgs: items,
-                    hasBinary: true, withDatas: emitDatas.count, toNamespace: self.nsp, wantsAck: self.currentAck)
+                    hasBinary: true, withDatas: emitDatas.count, toNamespace: self.nsp, wantsAck: ack)
             }
             
             self.engine?.send(str, datas: emitDatas)
         } else {
-            if !ack {
+            if ack == nil {
                 str = SocketEvent.createMessageForEvent(event, withArgs: items, hasBinary: false,
                     withDatas: 0, toNamespace: self.nsp)
             } else {
                 str = SocketEvent.createMessageForEvent(event, withArgs: items, hasBinary: false,
-                    withDatas: 0, toNamespace: self.nsp, wantsAck: self.currentAck)
+                    withDatas: 0, toNamespace: self.nsp, wantsAck: ack)
             }
             
             self.engine?.send(str)

        return self.emitWithAck(event, args)
    }
    
    private func _emit(event:String, _ args:[AnyObject], ack:Bool = false) {
        var frame:SocketEvent
        var str:String
        

            ackNum: self.currentAck, socket: self)
        self.ackHandlers.append(ackHandler)
        
        dispatch_async(self.emitQueue) {[weak self, ack = self.currentAck] in
            self?._emit(event, args, ack: ack)
            return
        }
        
