Uddate pagination to accommodate query strings