fix bug in csv parsing