Modify delete function