Set the function to compare the title of the active window and the previous window