Added function to get root path of template