Added getNodeFromDevice function