logical fix for csv output sanitising