finish the script