Create requiredIf method