fixed some template issues