javascript async function returns promise