safe guard for nil