Fix to use script local variable