dynamic page numbers while getting links