Changed AttributeError to AssertionError