Updating toArray call