update run_script and change functions