modify window.open method