Fixed error regarding counting successfully sent messages