improved clarity of validateRequiredField function:removed settings.required and added array as param