correct template errors