updated demo project to show how to use the delegate