Fix a bug of pooling connections