slight change to json parse code