corrected issue with pdf generation