copy template to output