fix error when labels are generated