further modified undo for tagging