Fixed the region conflict issue with stepwise undo