fix duplicate index problem