 	}
 
 	public func allocate(nodeName name: String, image img: CNImage, initStatus istat: KCSpriteNodeStatus, initAction iact: KCSpriteNodeAction, condition cond: KCSpriteNodeCondition, context ctxt: CNOperationContext) -> KCSpriteNode {
-		if let curnode = mNodes[name] {
-			return curnode
+		if let nodeinfo = mNodes[name] {
+			return nodeinfo.node
 		} else {
 			/* Setup node */
 			let newnode  = KCSpriteNode(graphiceMapper: mMapper, image: img, initStatus: istat, initialAction: iact, condition: cond)
 			newnode.name    = name
-			mNodes[name]    = newnode
+			mNodes[name]    = NodeInfo(node: newnode, context: ctxt)
 			/* Setup context */
 			KCSpriteOperationContext.setName(context: ctxt, name: name)
 			KCSpriteOperationContext.setInterval(context: ctxt, interval: 0.0)
 			KCSpriteOperationContext.setStatus(context: ctxt, status: istat)
 			KCSpriteOperationContext.setAction(context: ctxt, action: KCSpriteNodeAction())
-			mContexts[name] = ctxt
 			CNExecuteInMainThread(doSync: false, execute: {
 				[weak self] () -> Void in
 				if let myself = self {


		/* Set inputs for each node */
		for name in mNodes.keys {
			if let action = mNodes[name]?.action, let status = mNodes[name]?.status, let op = mContexts[name] {
				KCSpriteOperationContext.setName(context: op, name: name)
				KCSpriteOperationContext.setInterval(context: op, interval: interval)
				KCSpriteOperationContext.setAction(context: op, action: action)
				KCSpriteOperationContext.setStatus(context: op, status: status)
			} else {
				log(type: .Error, string: "Invalid properties", file: #file, line: #line, function: #function)
			}
		}

		/* Execute the operation */
		let nonexecs = mQueue.execute(operations: Array(mContexts.values), timeLimit: nil)
		if nonexecs.count > 0 {
			if let cons = console {
				cons.error(string: "Failed to execute some operations\n")

	}

	private func syncRemove(nodeName name: String){
		if let nodeinfo = mNodes[name] {
			self.removeChildren(in: [nodeinfo.node])
			mNodes.removeValue(forKey: name)
		}
	}

