adds validation.