fixing old demo code