changes pages logic to xpath too