Fix the behavior when you do undo
Fix the behavior when you do undo