captureInsertComponent to improve undo