add callback when adding more template files