Usage of wrongly implemented forEach corrected