Changed for loop to foreach when backing up.