For each ui element keeps looping through ui elements

Hi,
I’m using the “For each ui element” activity to edit a html data table. The table can be one or several pages long. I’ve enabled “Extract data from multiple pages” My issue is when the table is only one page the activity keeps looping through all the ui elements endlessly.
Any help is greatly appreciated!

You can use an if condition and then use break to come out of the loop