fixed critical bug in connection pool