fixed closedir(problem)