fix 1 typo
change logic order, this may reduce php warning message in compiled template