replacing index