fixed json decoding condition