Added a try catch in download() method