fixed undifines $templatePath