fix logic in connection pool
fix logic in connection pool