undid changes to download function