better for loop dom update batching