fixed scripts bug