Fix pdf downloader to handle exceptions