fixed repaint issues