fix error outputting