javascript async function return boolean