fixes for pdf downloads