Revised script-base.js