fix bug, while-loop iocopy in sync