CvTemplateController modified