fix template redirect