Fixed get_route() function