fixed bug on outfile CSV