fix bug at template