updated example to support ready and notReady