JOOScript don't work in header (Writer)

I fill in the data through the script in the header (in a Writer):
Scenario…
Script type: JOOScript
Text: ${root.INFOBLOCK.personName}
And I get the error: Expression root is undefined on line 6, column 411 in styles.xml
The same script in the body of the document (not the header and footer) works without errors. What to look at?

Oh sorry. I was assign alias “root” after fill header.