fixed the reading of template.html