fixed remove index logic for batch updates