fixed 'java.net.SocketException: Too many open files' bug