change delete to use promises