Fixed bug with pdf downloads