add closedir() to close DIRECTORY