fixed a bug in the template