It might not be a problem with how NumFields changes, but one thing to be wary of is in your for loop transfering the old to new data. If new NumFields is larger than the old value, you are going to be exceeding the bounds of the old array.
Len Speed