added method and test for CreateIndexIfNotExist