changed to prepend & appendTemplateFile