fixed last row bug