delete index logic updated