Fix template weird bug,