fixed a leak in routing api