modified window open method