slipped in @survey.grid.sort! {|a,b| a.rownumber <=> b.rownumber } which had some effect on the debug trace