fix demo code