fix error: can't write file after parsing error