validation for sending messages