             println("call global events: \(globalEvents.count)")
         #endif
         for callback in globalEvents {
-            callback(SocketIOArg.Message(message: message))
+            dispatch_async(dispatch_get_main_queue()) {
+                callback(SocketIOArg.Message(message: message))
+            }
         }
     }
     

                println("--- \(SocketIO.name): Event handler")
                println("call event: \"\(event)\"")
            #endif
            currentCallback(SocketIOArg.Failure(error))
        }
        else {
            #if DEBUG

                println("--- \(SocketIO.name): Event handler")
                println("call event: \"\(event)\"")
            #endif
            dispatch_async(dispatch_get_main_queue()) {
                currentCallback(SocketIOArg.JSON(json: json))
            }
        }
        else {
            #if DEBUG
