fixing postMessage script.