proper scripting error handling