In case of error, values from the previous loop were kept