handle whitespace variations in json