Fixing createUrl() function (it was returning the same link always).