fix index n+1