use promise for resolve