Modify code:

- checking exists index before create or using that index