update downloader.js
using native for loop