wrap demo in anonymous function.