Parent attribute was not found

...hacking my way thru...

trying to set up a process that creates a new material attribute but I'm getting a "Parent attribute was not found" error. Here is what I have.. hope it is enough.

proc setTripUserAttr( string $node, string $attr, float $val, string $mat )
{
select $node;
if ( !attributeQuery -n $node -exists $attr )
{
addAttr -ln $attr -at "float" ;
}

if ( `attributeQuery -n $node -exists $attr` )
{
	addAttr -ln ("TM" + $attr + "Conn") -at "double3"  $mat;
	addAttr -ln ("TM" + $attr + "Conn") -at double -p $mat;
	addAttr -ln ("TM" + $attr + "Conn") -at double -p $mat;
	addAttr -ln ("TM" + $attr + "Conn") -at double -p $mat;	
	setAttr -type double3 ($mat + "." + $attr) 0 0 0;
}
else
{
	warning( "could not create attr " + $attr + " on node " + $node + "n" );
}

}

thanks,
--TOM