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

        }
        if totalSize > 0 {
            if validateResponse(buffer, bufferLen: totalSize) {
                dispatch_async(dispatch_get_main_queue(),{
                    //self.workaroundMethod()
                    if let connectBlock = self.connectedBlock {
                        connectBlock()

                    writeError(CloseCode.Encoding.rawValue)
                    return false
                }
                dispatch_async(queue,{
                    if let textBlock = self.receivedTextBlock{
                        textBlock(str!)
                    }
