added seperate fn for download, and minor checks to prevent warning being shown(for eg mkdir)