Fixed pagination to work if url contains single-quotes