updated simple example to work asynchronously