fix some bugs in demo