added a function checking for script output.