Fixing memory issue when logs get backed up