fixed bug where multiple messages in one receive do not get processed