manage index if doesn't exist