Fixing bug in csv