Fixed bug with duplicate total rows appearing