added json_msg function