use write-json instead of write, for same reasons as json-str is used instead of write-str (see prev commit)