fixed bugs
new template engine