fix duplicate printing