close dir after finishing reading contents of dir