Fix switching template