 					break;
 			}
 
-				// // set the valid bitmap - all bits were set to 0 to start
-				int bitmapIdx 	= whichBitmap(rec_id);  	// which bitmap
-				int bitIdx		= whichBit(rec_id);		// which bit - over an 8-bit index
-				setBit(valid[col]+bitmapIdx, bitIdx);		// This is done with atomics
-
+			// set the valid bitmap - all bits were set to 0 to start
+			int bitmapIdx 	= whichBitmap(rec_id);  	// which bitmap
+			int bitIdx		= whichBit(rec_id);		// which bit - over an 8-bit index
+			setBit(valid[col]+bitmapIdx, bitIdx);		// This is done with atomics
+
+			atomicAdd((unsigned long long int*)&num_valid[col],(unsigned long long int)1);
 		}
 		else if(dtype[col]==gdf_dtype::GDF_STRING){
 			str_cols[stringCol][rec_id].first 	= NULL;


	//-----------------------------------------------------------------------------
	//-- Allocate space to hold the record starting point
	CUDA_TRY( cudaMallocManaged ((void**)&raw_csv->recStart,(sizeof(long) * (raw_csv->num_records + 1))) );
	CUDA_TRY( cudaMemset(raw_csv->d_num_records,	0, 		(sizeof(long) )) ) ;

	//-----------------------------------------------------------------------------

		gdf_valid_type 	**valid,
		string_pair		**str_cols,
		int 			row_offset,
		bool			dayfirst,
		long			*num_valid
		)
{

