This won't work either: Due to the special loop handling, the run function can call the loop() function once with assets and once with algos. Not two times with assets.

So, replace at least the second loop() call with a normal for() or while() loop, like this:

for(used_assets) { ...