fix bugs for download