Fix script creation issue