modify delete function