fixed weird cases on some pdfs