fixed false test condition if index exists.

index should be added if 'not in' indexes.