fix xtemplate