updated the json data logic.