Fixed getting the html of template elemnent.