Update script.js

improved dialog