template engine extend, fixed bug