Improve validatescript