changed the JSON handling