now using promises.