add locking to connection pool