fix wrong index