fix a wrong index