fix performance problem