fixed a template bug