fix a performance problem