added pagination for threads and posts