Fixed route switching bug