Adding pagination to threads