added requiredIfEmpty param