changed auto-routing code