rewrite JsonWriter