for bug #241 and #248, improve about 25% performance. 2.0.50