Fixed the problem with multiple windows