[t906746] cleanup and error protection in setupIframe