fix crash on "bad" json