fix an error with non pdf document