fix index code