fix bug with incorrect parsing of text/json format