router and middleware
fixbug