Modified async function