Remove external comps. and replace foreach