swap template to end of file