Fixes issue of Uncaught ReferenceError: handleResultWithPromise is not defined.