added TemplateListener
remove a bit of debug