As per discussion with Joseph, the variable app isn't initialized when it's called.

Alternatively, you can create a self variable and use `self.collectorNumber` in the if statement. i.e.

```javascript
       var self = this;
       var setHeader2 = function (xhr) {
           if (self.collectorNumber) {
               xhr.setRequestHeader('X-LO-COLLECTOR-NUM', self.collectorNumber);
           }
           xhr.setRequestHeader('X-LO-API-CLIENT-KEY', '0c921fb9-8e73-4349-bef5-e7960551b4ca');
           xhr.setRequestHeader('Accept-Language', 'en-CA');
           xhr.setRequestHeader('X-LO-DEVICE-ID', blackberry.identity.uuid);
           xhr.setRequestHeader('DEVICE_TYPE', 'BB10');
       };
```