Added pagination to the threads view.