Attempt to fix pdf generation