Fix script generate