add router and fix bug