fix error in download()