fixed memory leak on network connection