```javascript
if (err) {
  self.emit('error', err);
  return cb(err);
}
```

The callback should always be the last thing called in a function.