change router and fix bugs