[BUGFIX] Check if popup window is there before focusing it