Fixing issues with url generation