Fixed race condition in demo.