Fixed donwload function.