fix intermediate  issue with undo redo