Added transactions to allow for undo if a user cancels an edit.