fix connection pool bugs