added recursively walk through template