fixed some bugs with TemplateEvent.COMPLETE