track dir func