Made function for sending messages