fix serious performance problem.