Fix bug when restarting transfer