Adds validation checks for messages