Used another solution based on postMessage