updated pdf generation