can define a max history in router
fix test
fix bug when navigating back and then switching route