fix templates end lines