tweak download process to cache files correctly.