fixed generate script