fixed demo functionality