add promises for xhr