added a sync to async function