coerce empty strings to null to avoid errors