update script to resolve some bugs.
resolve some bugs.