fixed message handling, but may be caused by bug in client