fixing an issue of sending messages