Implement callback function for edit().