added $uri variable to templates