'size' variable is not defined in queryPeriod