fix bug when server quits unexpectedly during file sending