fix template caching issue