Fixes popup callback to use promises correctly.
Merge pull request #257 from fmoloney/popupCallbackFix

Fixes popup callback to use promises correctly.