fix issue with multiple windows