fixed URI calculation