save template into another variable to fix sort issue