As `close` is not an asynchronous function, this should be modified to:
```
self.close();
if (callback) {
  callback();
}
```