fix flash message on PDF generation