added condition to check if node is pure