Fix too many open files error