use asyncEach instead of for to support async template loaders.