fixed problem with pdf generation