fix immutable object assignment for undo