handle primitives in array for heap objects