 	// write new velocity back to original unsorted location
 	// *** let's tweak a little bit :)
 	if (!(isfinite(derivVelRho.x) && isfinite(derivVelRho.y)
-			&& isfinite(derivVelRho.z) && isfinite(derivVelRho.w))) {
-		printf("Error! particle derivVelRho is NAN: thrown from SDKCollisionSystem.cu, collideD !\n");
+			&& isfinite(derivVelRho.z) )) {
+		printf("Error! particle derivVel is NAN: thrown from SDKCollisionSystem.cu, collideD !\n");
+		*isErrorD = true;
+	}
+	if (!(isfinite(derivVelRho.w))) {
+		printf("Error! particle derivRho is NAN: thrown from SDKCollisionSystem.cu, collideD !\n");
+		*isErrorD = true;
 	}
 	sortedDerivVelRho_fsi_D[index] = derivVelRho;
 }

	int2 updatePortion = mI2(0, referenceArray[referenceArray.size() - 1].y);
	// int2 updatePortion = mI2(referenceArray[0].x, referenceArray[0].y);

	uint nBlock_UpdateFluid, nThreads;
	computeGridSize(updatePortion.y - updatePortion.x, 128, nBlock_UpdateFluid,
			nThreads);
	UpdateFluidD<<<nBlock_UpdateFluid, nThreads>>>(mR3CAST(posRadD),
			mR3CAST(velMasD), mR3CAST(vel_XSPH_D), mR4CAST(rhoPresMuD),
			mR4CAST(derivVelRhoD), updatePortion, dT);
	cudaThreadSynchronize();
	cudaCheckError()
	;
}
//--------------------------------------------------------------------------------------------------------------------------------
// updates the fluid particles by calling UpdateFluid_init_LF

	if (!(isfinite(vXSPH.x) && isfinite(vXSPH.y)
			&& isfinite(vXSPH.z))) {
		printf("Error! particle vXSPH is NAN: thrown from SDKCollisionSystem.cu, newVel_XSPH_D !\n");
		*isErrorD = true;
	}
	vel_XSPH_Sorted_D[index] = vXSPH;
}
