fix generate problems