bug fix to script execution