prevent crash when too many files are opened