fix asynchronous call.
modify the example to reflect new changes.