fixed redraw problem