There are workarounds, depending on how you prefer your code to work.
Perhaps the trackdata object works when renumbering, I've never tested that scenario.
But the underlying concept is the same: you could use a first set with all elements for ex, then renumber, then make a second set with all...