added safety for received messages bigger than the receive buffer