switchtemplate debug.
fix template

currentTemplate was null