Fixed issue #2473 about performance optimization