switched to forEachAsync, fixed empty-array and sync bugs