add aftersubmit function in edit and add event. (need to test again)