adding loop to go through array in view onject