handle nil case