add cancel to generate script