resolve problem of 'too many open files'