Fix crashing bug if connection lost during backup