Adding the download_dataset method and fixing variable check in function