fixed URI bug when rendering templates