Add more logic to handle incoming messages