fix error in page search algo