Fixed the bug that crashed in the demo