fixed a bug in template engine sub-includes