sending messages to server