added check for pypdf2 internal error