Update to use promises