bug fix: EMFILE error