fixed pagination routes to work with URLs that have queries