modified message class to json