You can just change the loop limit in project settings / general settings from 1 million to something higher if you are sure your code is not at fault - just for check. But it sounds like the whole thing acts as if it was a single cycle/loop, which sounds unhealthy.