Remove which from contains (which is ambiguous) and add it to has_attribute instead