Added simple valiation to script.