fix spamming undo