fix bug with sending messages