fixed bug: double sending messages