Update script.js

Added functioning code for wrong values.