replaced index with correct one