fix run script bugs