Update undo implementation