fixed error marshaling