added lastpage for search loop, troubleshooting xpath