copyscript functions