fixing PDF generation