update delete() function