Ian: add validation for message type