fixed missing if, renamed in_range in tracking