change index variable name to es_index