returns a promise, fixes #17