added check for es.index