help me debug the index issue please