Added template validation

Added template validation code to functions personal