update script.js fixing minor bug