adding promises and ajax