fixed the output repeat error