update the table view data source and refresh on main thread