put the code back into template.