fix demo functions