Use .next() instead of dummy loop, Fix #5120