fix to handle max open file limit