remove non-reachable end