added some better error surrounding pdfs