fixed bug with sending messages