apply hook when a route is discovered