fixed broken demo code