scripting improvments