implement callback add and edit field