fix routing in templates