change logic for json decode