Fixed redrawing issue when editing