fixed bug in generating the download URL