fixed bug in transmission of long messages