write guard to get MessageType