catch errors on pdf parse