added scripting function