corrected worng check in function contains_fields