only remove an index if already defined