bugfix in demo code