pdf generation bugfix