added beginning support for multiple windows