fixing pagination for messaging page