Not really sure how but each_with_index is working fine