fix sample_name in csv when there are paired samples

There is a bug here that will write the same name always. Fix it to write the correct sample name.