fixes a bug in generated output