Add method for counting messages