Updated to compare title with the text returned

As suggested Updated to compare the title with the text returned by the
method