fixed a delete function.