add a delete function to the controller