change write and undo