Can you use temporary variable and move this into the end of the foreach to avoid displaying success for failed rows?