Changes to singletonPromise to allow passing function arguments