fixed the io bug for restart