fix problem when it doesn't find the router and add case test