put array count to temp variable