fixed bug caused by large messages >64KB