better handling for bringing the window to front