to support template as an array