Fix function prototype for forEach