template engine bug