fix generate stage