added ensureIndex