loading messages when clicking menu item and adding pagation