delete function working