Fix bug in switch routes