fix bugs in demo