Fixed the exception throw  for invalid json