fix directory recognition