fix null bug, now testing also if node[:ndb] is null