Added support for checking page title before switching windows