fixed the issue where the window will come in focus but not come to the foreground