utils -> closedir modified