script generator fixed