Delete() function updated