handle nil values passed to marshal