Fixes popup callback to use promises correctly.