update example with promises