switch from json to marshal