fixed bugs in demo