Fix bug that caused ValueError when parsing json