fixed some template errors