Added a delegate method to know when editing ends.