removed encode_json_text function again