Handle route switching