added validation for a template