Fixing scripting error