whitespace error fix

instead of reading as a string . read char by char