prevent to nil reference