fixed the rerouting issue