fixed connection memory leak.