Fix the recursive call on getting all routes algorithm