Add more logic to processMessage.