 
   # Create instance
   syncState.instancesToCreate.forEach((instances, parent) ->
-    instances.forEach((instance, index, thisArray) ->
+    instances.forEach((instance, key, thisSet) ->
       if rpcReq?
         completed = false
       else


  # Delete instance
  syncState.instancesToDelete.forEach((instances, parent) ->
    instances.forEach((instance, index, thisArray) ->
      if rpcReq?
        completed = false
      else

          type: 'DeleteObject'
          objectName: instance.join('.') + '.'
        }
        thisSet.delete(instance)
    )
  )

