fix template engine