fix when not setting a template error.