Add error management. Protect sort node after scalar result node.