fix unbound var in ball heuristic