turns async function into sync