wrap async function into the promise