Fix for pdf generation