runtime template validation