fix incorrect definition of necessary nodes