 					for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
 					{
 						arguments.current = loc.i;
+						arguments.totalCount = loc.iEnd;
 						loc.jEnd = ListLen(loc.query.columnList);
 						for (loc.j=1; loc.j <= loc.jEnd; loc.j++)
 						{

		// if no layout specific arguments were passed in use the this instance's layout
		if(!Len(arguments.$layout))
			arguments.$layout = $useLayout(arguments.$action);

		// if renderPage was called with a layout set a flag to indicate that it's ok to show debug info at the end of the request
		// never show debugging out in ajax requests
		if ((!IsBoolean(arguments.$layout) || arguments.$layout) && !arguments.$hideDebugInformation)
			request.wheels.showDebugInformation = true;
		if (application.wheels.cachePages && (IsNumeric(arguments.$cache) || (IsBoolean(arguments.$cache) && arguments.$cache)))
		{
			loc.category = "action";

			}
			else if (StructKeyExists(arguments, "objects") && IsArray(arguments.objects))
			{
				loc.array = arguments.objects;
				StructDelete(arguments, "objects");
				loc.originalArguments = Duplicate(arguments);
				loc.modelName = loc.array[1].$classData().modelName;
				loc.returnValue = "";
				loc.iEnd = ArrayLen(loc.array);
				for (loc.i=1; loc.i <= loc.iEnd; loc.i++)
				{
					StructClear(arguments);
					StructAppend(arguments, loc.originalArguments);
					arguments.current = loc.i;
					arguments.totalCount = loc.iEnd;
					arguments[loc.modelName] = loc.array[loc.i];
					loc.properties = loc.array[loc.i].properties();
					StructAppend(arguments, loc.properties, true);
					loc.returnValue = loc.returnValue & $includeAndReturnOutput(argumentCollection=arguments);
					if (StructKeyExists(arguments, "$spacer") && loc.i < loc.iEnd)
						loc.returnValue = loc.returnValue & arguments.$spacer;
