fix null reference in message processing