modify sync function call to async function call