added reflow and repaint