Updated switchToWindow with title tag