Make sure dicts are json strings before publishing