code index match bug fixed