upodated contains_fields function