Oh of course!! How dumb of me😁 I was trying to call the attributes of z without using z.attrib1!!
I rewrote my original script to include it and everything works perfectly!!