fix last row calc