Avoiding fieldsModified undefined index error