Improved sending message functionality