Added extra variable in the method setSendStateObj

- Variable is important to get the number of messages