fixed bug in connection pooling