Additional patch for #1279

If a message is not json, there are possible problems in escpaing.