avoid nil dereference