fixed issue-4: too many open file handles