demo code fixed