fix a speed bug