create example to show loop handling in cdi