updating for downloading function