repaint before dialog box