fix main script and update demo