replaces async with promises