fixed parse and generate