Updated to handle correct counting of messages as per Acatar