Add guard for nil