Fix URL generation error