fix bug when message isn't a JSON string