Adding the delete function to the edit controller.