pagination functionality

I have added a pagination functionality for the chat window