fixed a bug of stats connection leak