Fix iframe onBeforeWrite