Loop.finished=true works offline but doesn't work online

Description of the problem:
PsychoPy version: 2020.1.3
Os: Win10

Hi everyone, I want to display 64 stimuli among a pool of 851 stimuli, so I need the Loop (the name of Loop I set is obsertrials) to end when the number of trials reached 64. I used a code component in the loop and write the code in the End Routine Tab as follows:
image

It can work perfectly offline in my computer, but when I upload it on Pavlovia, it doesn’t work any more. The Loop will continue until all the 851 rows/stimuli are selected.

I also try to use the solution mentioned in Loop.finished=true No longer working , take “end the loop on the 2nd repetition of that current loop” as an example, it suggested that use code as:

if (currentLoop.thisRepN == 2)
{
trials.finished = true; // to end any loop, use ‘trials’
}

I tried to use this code, but the Builder set a error like:
NameError: name ‘trials’ is not defined

Since there are three loops in my Flow, like as follows:


I changed the name of first loop from “obsertrials” to “trials”, and the code “if trials.this N==63 trials.finished=true” can work both offline and online (interesting). But there are still two loops left, and I want them end after certain number of stimuli displaying just like the first one. But it is impossible for me to change all three names of loops to “trials” at the same time, because they should differ from each other.

Is there any suggestions?
Thanks very much in advance for any help.