add the controller's function of edit