fixing async for loops properly