Changing menu state based on the route.