changed download-function.