handle nil values in Scan