add compat function (json support)