fix exception when templ is not eixsting.