Introduce index checking