Use a transaction for adding the tag and indenting