Fixed a big bug in PDF url generation