fix generate script