Switch to forEach loop

[ci skip]