replace async with defer