Update example to wait for app.on('ready')

Related to Issue #383