fixed bug in parsing JSON state