fixes in demo(), which was not working