new method of json decoding