#8. added encoding set in serializing message for sending