corrected typo and wrong var reference in csv handling