                 })
             } else if response.code == .BinaryFrame {
                 let data = response.buffer! //local copy so it is perverse for writing
-                dispatch_async(dispatch_get_main_queue(),{
+                dispatch_async(queue,{
                     //self.workaroundMethod()
                     if let dataBlock = self.receivedDataBlock{
                         dataBlock(data)

            if !connected {
                connected = processHTTP(buffer, bufferLen: length)
                if !connected {
                    dispatch_async(dispatch_get_main_queue(),{
                        //self.workaroundMethod()
                        let error = self.errorWithDetail("Invalid HTTP upgrade", code: 1)
                        if let disconnect = self.disconnectedBlock {

        outputStream = nil
        isRunLoop = false
        connected = false
        dispatch_async(queue,{
            if let disconnectBlock = self.disconnectedBlock {
                disconnectBlock(error)
            }
