avoid crash when the object is nil