finish undo edit function