Add stall detect code

Stall detect code in ball search.