use forEach internally