escape early on invalid json