fix Function use wrong Template when execute, also fix not regist correct template to exception stack #1