fixed a bug in the demo