Added function to detect external node