Fixed a repaint issue