This usually causes problems when loading over ajax...
Please add it directly in the layout output...