Adding the save function to the edit controller.