1. Added deferred to generator method.
2. Added when library to dependencies
3. Updated example file