make template a valid html file