update demo and add some logging