fix scripts bug