tweak pagination to support custom base url