changed delete to use the new api